package db

const TableNameActivity = TablePrefix + "activity"

type Activity struct {
	BaseModel
	Name      string `gorm:"column:name;type:varchar(255);default:'';comment:昵称" json:"name" form:"name"`                                      // 活动名称
	Img       string `gorm:"column:img;type:varchar(255);default:'';comment:活动图片" json:"img" form:"img"`                                       // 活动图片
	Shows     bool   `gorm:"column:shows;type:tinyint(1);default:0;comment:1开启,关闭" json:"shows" form:"shows"`                                  // 1开启,关闭
	Module    string `gorm:"column:module;type:varchar(255);default:'';comment:模块" json:"module" form:"module"`                                // 模块
	StartTime XTime  `gorm:"column:start_time;type:datetime;default:'0000-00-00 00:00:00';comment:活动开始时间" json:"start_time" form:"start_time"` // 活动开始时间
	EndTime   XTime  `gorm:"column:end_time;type:datetime;default:'0000-00-00 00:00:00';comment:活动结束时间" json:"end_time" form:"end_time"`       // 活动结束时间
}

func (*Activity) TableName() string {
	return TableNameActivity
}

type ActivityHasManyCondition struct {
	Activity
	ActivityCondition []ActivityConditionHasManyReward `gorm:"foreignKey:ActivityID;references:ID" json:"activityCondition"`
}
